<template>
  <el-tree :default-expand-all="expandAll" @node-click="send" :data="data" :props="defaultProps" highlight-current :show-checkbox="showCheckbox" node-key="id" ref="tree"></el-tree>
</template>

<script>
export default {
  props: {
    data: {
      type: Array,
      default:()=>[]
    },
    labels:{
      type:String,
      default:"label"
    },
    showCheckbox:{
      type:Boolean,
      default:true
    },
    expandAll:{
      type:Boolean,
      default:false
    }
  },
  data() {
    return {
      defaultProps: {
        children: "children",
        label:this.labels
      }
    };
  },
  methods:{
    send(a,b,c){
      this.$emit("sendInfo",a)
    }
  }
};
</script>

<style lang='less' scoped>
</style>
